import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int n = in.nextInt();
        int l = in.nextInt();
        int r = in.nextInt();
        in.nextLine();
        char[] c = in.nextLine().toCharArray();
        Map<Character, Integer> map1 = new HashMap<>();
        int ret = 0;
        int left = 0;
        int right = 0;
        while (right < n) {
            while (right < n && map1.size() <= r) {
                int count = map1.getOrDefault(c[right], 0) + 1;
                map1.put(c[right], count);
                if (map1.size() >= l && map1.size() <= r) {
                    ret++;
                }
                right++;
            }
            while (left < right && map1.size() >= r) {
                int tmp = map1.get(c[left]) - 1;
                map1.put(c[left], tmp);
                if (tmp == 0) {
                    map1.remove(c[left]);
                }
                if (map1.size() >= l && map1.size() <= r) {
                    ret++;
                }
                left++;
            }

        }
        if (l == 1) {
            ret += c.length;
        }
        System.out.println(ret);
    }
}
